# 导包
import time
import unittest
from scripts.test01_login import TestLogin
from scripts.test03_employee import TestEmployee
from tools.HTMLTestRunner import HTMLTestRunner


# 封装测试套件
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestLogin))
# suite.addTest(TestLogin("test01_case001"))
suite.addTest(unittest.makeSuite(TestEmployee))
# 指定测试报告路径
# report = "./report/report-{}.html".format(time.strftime("%Y.%m.%d-%H.%M.%S"))
report = "./report/report.html"

# 文件流形式打开文件
with open(report, "wb") as f:
    runner = HTMLTestRunner(f)
    runner.run(suite)